Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Tests and documentation still need to be written, this is just for preliminary feedback.)
A basic implementation for #834
It leverages
groups_for_modules
to provide the usual UI presentation, and to leverage the current ordering ability. As suggested by José, anest_module_aliases
key was added to the docs config.This new value is an array of alias configs, each of which is one of:
ModuleName
(equivalent to{ModuleName, as: ModuleName}
){Super.Duper.Really.Long.ModuleName
, as:Some.ModuleName
}{Super.Duper.Really.Long.ModuleName
, as: "My module"}The
as:
values are used as group names (as if they had been provided togroups_for_modules
) and are removed from the module's displayed title.Hopefully, this will be familiar to language users as it combine the
as:
syntax of module aliases with the multiple value formats as can be used when specifying child configs in supervisors.The objective for this first implementation is to provide enough flexibility while keeping the code changes simple. It is to be noted that the aliasing is very naive: the first match is kept, without attempting to find the longest prefix possible.
With these modifications, nesting could be specified like this (adapted from ExDoc's
mix.exs
):Adding empty groups matching
as:
values (or the module name, if absent) innest_modules_aliases
allows controlling the ordering of the blocks of nested modules.Here's the generated result: